home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 187_01 / get_cur.a < prev    next >
Text File  |  1985-12-28  |  2KB  |  68 lines

  1. ; @************************************************************************
  2. ; @
  3. ; @    This subroutine is modeled after the DeSmet PCIO.A routines.
  4. ; @    It calls interrupt 10 to get the current cursor position.  In 
  5. ; @    conjunction with the DeSmet routines, this allows you to save the 
  6. ; @     current position, jump to a new area, and return.
  7. ; @
  8. ; @        Usage:        get_cur(&row, &col);
  9. ; @
  10. ; @     The parameters row and col are modified.  get_cur does not return 
  11. ; @     a value. 
  12. ; @
  13. ; @************************************************************************
  14.         dseg
  15. ;    equates for bios interface.
  16.  
  17. ;    the interrupt and codes for the screen interface interrupt.
  18.  
  19. video        equ    10h        ;interrupt for dealing with screen
  20.  
  21. mode        equ    0        ;code for setting new screen mode
  22. curtype        equ    1        ;code for setting new cursor type
  23. setcur        equ    2        ;code for addressing cursor
  24. readcur        equ    3        ;code for reading cursor location
  25. readlp        equ    4        ;code for reading light pen position
  26. setpage        equ    5        ;code to select active page
  27. scrollup    equ    6        ;code to scroll screen up
  28. scrolldn    equ    7        ;code to scroll screen nown
  29. readch        equ    8        ;code to read a character from screen
  30. writeach    equ    9        ;code to write char and attributes
  31. writech        equ    10        ;code to write character only
  32. setpal        equ    11        ;code to set new setpal or border
  33. wdot        equ    12        ;code to write a dot
  34. rdot        equ    13        ;code to read a dot
  35. wtty        equ    14        ;code to write as if teletype
  36. state        equ    15        ;code to find current screen status
  37.  
  38.  
  39.  
  40.         cseg
  41. ;    get_cur_        get cursor position
  42.  
  43. ;                Usage:        get_cur(&row, &col);
  44.  
  45.         public    get_cur_        
  46. get_cur_:                ; clear rest of line
  47.         push    bp
  48.         mov    bp,sp
  49.         push    ax
  50.         push    dx
  51.         push    bx
  52.         mov    bh,0        ;assume page zero_
  53.         mov    ah,readcur    ;see where we are
  54.         int    video
  55.         mov    bx,[bp+4]    ;addr(row)      
  56.         mov    al,dh        ;get row
  57.         mov    ah,00        ;and make full word
  58.         mov    [bx],ax
  59.         mov    bx,[bp+6]    ;starting column
  60.         mov    al,dl        ;get column
  61.         mov    [bx],ax
  62.         pop    bx
  63.         pop    dx
  64.         pop    ax
  65.         pop    bp
  66.         ret
  67.  
  68.